<template>
	<view>
		
	</view>
</template>

<script>
	export default {
		name: "callapse",
		props: {
			localData: {
				type: Array,
				default: () => ([])
			}
		},
		data() {
			return {

			};
		},
		methods: {
			open(item, index) {
				console.log('index', index)
				// this.$emit('openEvt', {
				// 	item,
				// 	index
				// })
				let len = this.localData[index].children
				item.open = item.open > 0 ? 0 : len.length * 30
			}
		}
	}
</script>

<style lang="scss">
	.rotate {
		transform: rotate(180deg);
	}

	.rotate1 {
		transform: rotate(0deg);
	}

	.collapse {
		padding: 0 10px;
		overflow: hidden;

		.parent {
			height: 50px;
			position: relative;
			border-top: 1rpx solid #EEE;
			border-bottom: 1rpx solid #EEE;
			position: relative;
			z-index: 20;
			background: #FFF;

			.icons {
				width: 24px;
				transition: all .3s;
				position: absolute;
				right: 10px;
			}
		}

		.collapse-item {
			transition: all .2s;
			position: relative;
			z-index: 10;

			.children {
				position: relative;
				z-index: 5;
				background: #EEE;
				height: 30px;
				display: flex;
				align-items: center;
				padding: 0 10px;
			}
		}
	}
</style>